import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys

driver=webdriver.Firefox()
driver.get('http://10.59.9.14:7003/')

# 第一步
driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
time.sleep(2)

dl=driver.find_element(By.LINK_TEXT,'会员登录').text
print(dl)

driver.find_element(By.CLASS_NAME,'regi-input').send_keys('13811033962')

driver.find_element(By.NAME,'password').send_keys('123456')
time.sleep(5)

driver.find_element(By.CSS_SELECTOR,'.finish-btn').click()
time.sleep(5)

# 第二步
hy=driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').text
print(hy)

driver.find_element(By.LINK_TEXT,'首页').click()
time.sleep(2)

ss=driver.find_element(By.CLASS_NAME,'search-input')
ss.send_keys('手机')
ss.send_keys(Keys.ENTER)
time.sleep(2)

jg=driver.find_element(By.XPATH,'/html/body/div[4]/a[2]').text
print(jg)

# 第三步
driver.find_element(By.XPATH,'//img[@class="lazy" and @src="/uploads/images/20250718/fe4cd9cb407fd1fb4bbe2725daca6ae1.jpg"]').click()
time.sleep(2)

qk=driver.find_element(By.XPATH,'//input[@id="store_nums" or @class="input-regula"]')
qk.clear()
qk.send_keys(2)
time.sleep(2)

driver.find_element(By.ID,'buy-cart').click()
time.sleep(2)

qr=driver.find_element(By.LINK_TEXT,'确认订单').text
print(qr)

# 第四步
driver.find_element(By.ID,'address-31').click()
time.sleep(2)

driver.find_element(By.CLASS_NAME,'ask-btn').click()
time.sleep(2)

dd=driver.find_element(By.XPATH,'/html/body/div[4]/div[1]/a[2]')
print(dd)

driver.find_element(By.CLASS_NAME,'immediate-pay').click()
time.sleep(2)
# 第五步
wd=driver.find_element(By.XPATH,'/html/body/div[4]/a[3]').text
print(wd)












